/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.hk.media.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.service.TreeService;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.hk.media.entity.HkMediaShopCategory;
import com.thinkgem.jeesite.modules.hk.media.dao.HkMediaShopCategoryDao;

/**
 * 自媒体电商商品分类Service
 * @author 罗天文
 * @version 2018-06-20
 */
@Service
@Transactional(readOnly = true)
public class HkMediaShopCategoryService extends TreeService<HkMediaShopCategoryDao, HkMediaShopCategory> {

	public HkMediaShopCategory get(String id) {
		return super.get(id);
	}
	
	public List<HkMediaShopCategory> findList(HkMediaShopCategory hkMediaShopCategory) {
		if (StringUtils.isNotBlank(hkMediaShopCategory.getParentIds())){
			hkMediaShopCategory.setParentIds(","+hkMediaShopCategory.getParentIds()+",");
		}
		return super.findList(hkMediaShopCategory);
	}
	
	@Transactional(readOnly = false)
	public void save(HkMediaShopCategory hkMediaShopCategory) {
		super.save(hkMediaShopCategory);
	}
	
	@Transactional(readOnly = false)
	public void delete(HkMediaShopCategory hkMediaShopCategory) {
		super.delete(hkMediaShopCategory);
	}
	
}